<cfset stubbed = true>

<cfif stubbed>
Stubbed
<cfelse>

<cfinvoke component="#request.pathToGateways#.OrderGateway" method="query" returnvariable="orders">
	<cfif IsDefined("organizationID")>
		<cfinvokeargument name="Organization_ID" value="#organizationID#" />
	</cfif>
	<cfif IsDefined("userID")>
		<cfinvokeargument name="Ordered_By_ID" value="#userID#" />
	</cfif>
</cfinvoke>
			
			
<cfif workshops.RecordCount gt 0>
	<table class="table table-striped table-bordered">
		<thead>
			<tr>
				<th>ID</th>
				<th>Order Date</th>
				<th>Ship Date</th>
				<th>Status</th>
			</tr>
		</thead>
		<tbody>
			<cfoutput query="orders" group="Program_Year">
				<tr>
					<td colspan="4"><strong>#Program_Year#</strong></td>
				</tr>
				<cfoutput>
					<tr>
						<cfif IsUserInRole("Super User") and NOT IsDate(Fulfillment_Date)>
							<td><a href="#script_name#?view=editOrder&orderID=#Order_ID#">#Order_ID#</a></td>
						<cfelse>
							<td><a href="#script_name#?view=order&orderID=#Order_ID#">#Order_ID#</a></td>
						</cfif>
						<td>#DateFormat(Date_Created, "m/d/yyyy")#</td>
						<td>#DateFormat(Fulfillment_Date, "m/d/yyyy")#</td>
						<td>
							<cfif Approved eq 1>
								Approved
							<cfelse>
								<font color="red">Not Approved</font>
							</cfif>
						</td>
					</tr>
				</cfoutput>
			</cfoutput>
		</tbody>
	</table>
<cfelse>
	<div class="alert alert-info notFound">No orders</div>
</cfif>

</cfif>